package problem2269;

//2268.找到一个数字的k美丽值
//https://leetcode.cn/problems/find-the-k-beauty-of-a-number/

class Solution {
    public int divisorSubstrings(int num, int k) {
        String str = num + "";
        int n = str.length();
        int ret = 0;
        for(int i = 0; i<=n-k; i++) {
            String t = str.substring(i, i+k);
            int x = Integer.valueOf(t);
            if(x != 0 && num % x == 0) ret++;
        }
        return ret;
    }
}